Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reject tarball writes with no destinations #1534

Merged
merged 2 commits into from
Jan 3, 2021

Conversation

jchorl
Copy link
Contributor

@jchorl jchorl commented Dec 26, 2020

Description

Kaniko accepts a --tarPath arg to write out to a tarball. I mistakenly passed this without a --destination and ended up with a tarball with only a manifest.json containing null.

I opened google/go-containerregistry#887 to fix the issue in go-containerregistry (calculating a manifest without refs doesn't make much sense), but we should also check for this on the kaniko side with kaniko specific details to help users do the right thing.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes unit tests
  • Adds integration tests if needed.

There are no tests for the tarball write path as far as I can tell. Adding unit/integration tests to test this one check would be a substantial lift.

See the contribution guide for more details.

Reviewer Notes

  • The code flow looks good.
  • Unit tests and or integration tests added.

Release Notes

Describe any changes here so maintainer can include it in the release notes, or delete this block.

- kaniko will error if `--tarPath` is specified without `--destination` instead of building an invalid image

@google-cla google-cla bot added the cla: yes CLA signed by all commit authors label Dec 26, 2020
Copy link
Member

@tejal29 tejal29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks lot!! Only 1 nit.

pkg/snapshot/snapshot.go Outdated Show resolved Hide resolved
@tejal29 tejal29 merged commit ece215c into GoogleContainerTools:master Jan 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes CLA signed by all commit authors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants